import 'package:flutter/cupertino.dart';
import 'package:flutter_screenutil/flutter_screenutil.dart';

import '../../../../../../lib_baseview/lib_baseview.dart';
import '../../../../../../lib_baseview/theme/jr.dart';

/// 真爱榜头像控件
class TrueLoveAvatarWidget extends StatelessWidget {
  // final SimpleUser sender;
  // final SimpleUser receiver;
  final bool inRoom;

  const TrueLoveAvatarWidget({
    super.key,
    // required this.sender,
    // required this.receiver,
    this.inRoom = false,
  });

  // _showUserInfo(BuildContext context, SimpleUser user) {
  //   if (inRoom) {
  //     SimpleChannelUser simpleUser = SimpleChannelUser.create()
  //       ..id = user.id
  //       ..nickname = user.nickname
  //       ..avatar = user.avatar;
  //     RoomPersonalDataWidget.show(
  //         context, RootProxyModel.instance?.channel, simpleUser);
  //   } else {
  //     PersonalHomePage.show(context, user.id.toInt(), refer: 'true_love');
  //   }
  // }

  @override
  Widget build(BuildContext context) {
    return Stack(
      alignment: Alignment.topCenter,
      children: [
        Container(
          width: 100.w,
          height: 56.h,
          margin: EdgeInsets.only(top: 7.h),
          decoration: ShapeDecoration(
              shape: const StadiumBorder(), color: JR.color.trueLoveBg),
          child: const Stack(
            alignment: Alignment.center,
            children: [
              Text('PositionedDirectional')
              // PositionedDirectional(
              //   end: 2.w,
              //   child: GestureDetector(
              //     onTap: () => _showUserInfo(context, receiver),
              //     child: AvatarImage(
              //       url: StringUtil.formatImgUrl(receiver.avatar, size: 150),
              //       width: 52.w,
              //       height: 52.w,
              //       shape: BoxShape.circle,
              //       border: Border.all(color: JR.color.trueLoveBg, width: 2.w),
              //     ),
              //   ),
              // ),
              // PositionedDirectional(
              //   start: 2.w,
              //   child: GestureDetector(
              //     onTap: () => _showUserInfo(context, sender),
              //     child: AvatarImage(
              //       url: StringUtil.formatImgUrl(sender.avatar, size: 150),
              //       width: 52.w,
              //       height: 52.w,
              //       shape: BoxShape.circle,
              //       border: Border.all(color: JR.color.trueLoveBg, width: 2.w),
              //     ),
              //   ),
              // ),
            ],
          ),
        ),
        image('ic_true_love_top.png', height: 14.h, fit: BoxFit.fitHeight)
      ],
    );
  }
}
